package no.sachmuld.methodcombination.examples.annotation.strategy.v2;

import no.sachmuld.aspectjattach.AspectJAgent;

/**
 *
 */
public class Main implements Runnable {

    @Override
    public void run() {

        AspectJAgent.initializeIfNeeded();

        new Runnable() {

            @Override
            public void run() {

                Duck[] ducks = {
                        new MallardDuck(),
                        new DecoyDuck(),
                        new RubberDuck()
                };

                for (Duck duck : ducks) {
                    System.out.println(duck.getClass().getSimpleName() + ":");
                    System.out.print("  ");
                    duck.fly();
                    System.out.print("  ");
                    duck.quack();
                    System.out.println();
                }

            }

        }.run();

    }

    public static void main(String... args) throws Exception {

        new Main().run();

    }

}
